package de.uni.kassel.campusappver3.model;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;

/**
 * common return value for all crawler. 
 * each crawler has an unique keyset
 * @author ckonze
 *
 */
public class CrawlerReturnValue {
	
	private HashMap<String,ArrayList<String>> valueMap;
	
	public CrawlerReturnValue() {
		valueMap = new HashMap<String, ArrayList<String>>();
	}
	
	/**
	 * returns value of given key
	 * @param key
	 * @return
	 */
	public ArrayList<String> getValue(String key) {
		return this.valueMap.get(key);
	}

	public Set<String> getKeys(){
		return valueMap.keySet();
	}
	
	public void appendValue(String key, String value) {
		ArrayList<String> arrayList = this.valueMap.get(key);
		if(arrayList == null)
			arrayList = new ArrayList<String>();
		
		arrayList.add(value);
		this.valueMap.put(key, arrayList);
	}

}
